package com.example.zuoye.mvp.presenter;

import com.example.mylibrary.mvp.presenter.BasePresenter;
import com.example.zuoye.bean.PostBodyBean;
import com.example.zuoye.bean.TagTravel;
import com.example.zuoye.mvp.contract.PostContract;

import java.util.List;

import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;

public class PostPresenter extends BasePresenter<PostContract.Model, PostContract.View> {
    public PostPresenter(PostContract.Model mModel, PostContract.View mView) {
        super(mModel, mView);
    }
    public void requestBody(){
        mModel.requestBody(new Observer<List<PostBodyBean>>() {
            @Override
            public void onSubscribe(Disposable d) {

            }

            @Override
            public void onNext(List<PostBodyBean> list) {
                mView.initBody(list);
            }

            @Override
            public void onError(Throwable e) {

            }

            @Override
            public void onComplete() {

            }
        });
    }

    public void requestForm(){
        mModel.requestForm(new Observer<List<TagTravel>>() {
            @Override
            public void onSubscribe(Disposable d) {

            }

            @Override
            public void onNext(List<TagTravel> list) {
                mView.initForm(list);
            }

            @Override
            public void onError(Throwable e) {

            }

            @Override
            public void onComplete() {

            }
        });
    }
}
